
function deepClone(obj){
    if(!obj)return null;
    if(obj instanceof Array){
        return [].slice.call(obj);
    }
    let newObj = Object.create(obj.__proto__);
    Object.keys(obj).forEach(item => {
        if(typeof obj[item] == 'object'){
            newObj[item] = deepClone(obj[item])
        }else {
            newObj[item] = obj[item];
        }
    });
    return newObj;
}
export {
    deepClone
}